Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redirect already created users to the dashboard #653

Conversation

spaceo
Copy link
Contributor

@spaceo spaceo commented Nov 1, 2023

Link to issue

https://reload.atlassian.net/browse/DDFLSBP-229

Description

Users that already have been created should be redirected to the dashboard.
The CreatePatron component looks at the userinfo and checks if the current agency id exists in the agencies array.

Additional comments or questions

This should be merged before it's dpl-cms sibling.

We want to have a similar interface for querying openid data as we have
for the other APIS - starting with the useUserinfo hook.
They are going to be used for the "redirect users to the dashboard if
they are already created" - functionality.
It is a handy helper that is needed globally.
Also changed it to return all the properties from react-query in case we
need them in the future.
@spaceo spaceo force-pushed the DDFLSBP-229-brugeroprettelse-laner-der-er-oprettet-i-forvejen-vises-en-fejlside branch from 852623f to 5c743c6 Compare November 1, 2023 21:23
@spaceo spaceo changed the title Ddflsbp 229 brugeroprettelse laner der er oprettet i forvejen vises en fejlside Redirect already created users to the dashboard Nov 2, 2023
And put it where the other clients reside. No reason to do it differntly
than the others...
@spaceo spaceo force-pushed the DDFLSBP-229-brugeroprettelse-laner-der-er-oprettet-i-forvejen-vises-en-fejlside branch from c883f54 to 99966a7 Compare November 2, 2023 08:19
@spaceo spaceo marked this pull request as ready for review November 2, 2023 08:26
@kasperg kasperg self-requested a review November 2, 2023 08:40
Copy link
Contributor

@kasperg kasperg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 nice. I especially enjoyed the refactorings.

There are some things that I think warrants a second thought.

src/core/adgangsplatformen/fetcher.ts Outdated Show resolved Hide resolved
src/core/adgangsplatformen/OpenIdServiceHttpError.ts Outdated Show resolved Hide resolved
src/core/utils/helpers/user.ts Show resolved Hide resolved
src/apps/create-patron-user-info/CreatePatron.tsx Outdated Show resolved Hide resolved
src/core/adgangsplatformen/useGetUserInfo.ts Outdated Show resolved Hide resolved
@spaceo spaceo force-pushed the DDFLSBP-229-brugeroprettelse-laner-der-er-oprettet-i-forvejen-vises-en-fejlside branch from c9a0f46 to fb427c6 Compare November 5, 2023 16:10
Like we do with other query hooks.
Also renamed useGetUserInfo.ts to seUserInfo.ts - no need to use a
different filename for the hook.
We should call the file the same as the error type.
@spaceo spaceo force-pushed the DDFLSBP-229-brugeroprettelse-laner-der-er-oprettet-i-forvejen-vises-en-fejlside branch from fb427c6 to 7c141f8 Compare November 5, 2023 16:45
@spaceo spaceo merged commit 94615ad into danskernesdigitalebibliotek:develop Nov 5, 2023
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants